Auto merge of #2988 - lifthrasiir:doc-open-with-target, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 14 Aug 2016 07:07:46 +0000 (00:07 -0700)
committerGitHub <noreply@github.com>
Sun, 14 Aug 2016 07:07:46 +0000 (00:07 -0700)
Make `cargo doc --open --target TARGET` work as expected.

Currently `cargo doc --open` opens `$TARGET/doc` unconditionally, but it is incorrect if the explicit target is specified.

The target directory should be same to what `Layout::new()` generates, and ideally it should use the same data source (it hadn't been so far), but I'm yet to find a good way to signal that. At least I'm pretty sure that `Compilation` is not a good position to put them (it assumes the bipartite "root"-"deps" separation which doesn't quite work in documentation).


Trivial merge